package com.zjsru.mapper;

import com.zjsru.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface UserMapper {
    
    @Select("select * from tb_user where user_id = #{user_Id}")
    User findById(@Param("user_Id") Long user_Id);
    @Select("select * from tb_user where username = #{username} and password = #{password}")
    User checkLogin(@Param("username") String username,@Param("password") String password);
    @Insert("insert into tb_user(username,password) values(#{username},#{password})")
    void register(@Param("username") String username,@Param("password") String password);
    @Select("select * from tb_user where username = #{username}")
    User findByUsername(@Param("username") String username);

    void updateUser(User user);
}